validate binary search tree